﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Customer.aspx.cs" Inherits="WebApp.Customer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">


    .style2
    {
        width: 278px;
        height: 36px;
    }
    .style3
    {
        height: 36px;
    }
    .style4
    {
        width: 278px;
        height: 31px;
    }
    .style5
    {
        height: 31px;
    }
    .style6
    {
        height: 32px;
        margin-left: 40px;
            text-align: left;
        }
    .style7
    {
        height: 32px;
    }
        .style10
        {
            height: 32px;
            width: 256px;
        }
        #Button1
        {
            width: 100px;
        }
        #Button2
        {
            width: 100px;
        }
        #Button3
        {
            width: 100px;
        }
        .style11
        {
            width: 256px;
            height: 36px;
        }
        .style12
        {
            width: 256px;
            height: 31px;
        }
        .style13
        {
            height: 32px;
            margin-left: 40px;
            text-align: center;
        }
    </style>
    <script language="javascript" type="text/javascript">
// <![CDATA[

        function Button1_onclick() {

        }

// ]]>
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table style="width: 99%; height: 162px;">
            <tr>
                <td class="style2">
                    <asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Customer No"></asp:Label>
                </td>
                <td class="style11">
                    <asp:TextBox ID="txtCustomerNo" runat="server" ClientIDMode="Static" 
                        ReadOnly="True">New Customer</asp:TextBox>
                </td>
                <td class="style3">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ErrorMessage="Please Enter your Customer Id" 
                        ControlToValidate="txtCustomerNo" ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style4">
                    <asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="First Name"></asp:Label>
                </td>
                <td class="style12">
                    <asp:TextBox ID="txtFirstName" runat="server" ClientIDMode="Static"></asp:TextBox>
                </td>
                <td class="style5">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ErrorMessage="Please Enter your First Name" 
                        ControlToValidate="txtFirstName" ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label3" runat="server" ClientIDMode="Static" Text="Last Name"></asp:Label>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtLastName" runat="server" ClientIDMode="Static"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ErrorMessage="Please Enter your Last Name" ControlToValidate="txtLastName" 
                        ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label4" runat="server" ClientIDMode="Static" Text="Email Id"></asp:Label>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtEmailId" runat="server" ClientIDMode="Static"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ErrorMessage="Please Enter your Email Id" ControlToValidate="txtEmailId" 
                        ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="txtEmailId" ErrorMessage="Enter Valid Formate" 
                        ForeColor="#FF3300" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label5" runat="server" ClientIDMode="Static" Text="Phone No"></asp:Label>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtPhoneNo" runat="server" ClientIDMode="Static"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                        ErrorMessage="Please Enter your Phone No" ControlToValidate="txtEmailId" 
                        ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label6" runat="server" ClientIDMode="Static" Text="Address 1"></asp:Label>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtAdress1" runat="server" ClientIDMode="Static" Width="206px"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                        ErrorMessage="Please Enter your First Address" 
                        ControlToValidate="txtAdress1" ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label7" runat="server" ClientIDMode="Static" Text="Address 2"></asp:Label>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtAddres2" runat="server" ClientIDMode="Static" Width="206px"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                        ErrorMessage="Please Enter your 2nd Address" 
                        ControlToValidate="txtAddres2" ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label8" runat="server" ClientIDMode="Static" Text="City"></asp:Label>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtCity" runat="server" ClientIDMode="Static"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                        ErrorMessage="Please Enter your City" ControlToValidate="txtCity" 
                        ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    <asp:Label ID="Label9" runat="server" ClientIDMode="Static" Text="State"></asp:Label>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtState" runat="server" ClientIDMode="Static"></asp:TextBox>
                </td>
                <td class="style7">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                        ErrorMessage="Please Enter your State" ControlToValidate="txtState" 
                        ForeColor="#FF3300">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style6" colspan="3">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                        ForeColor="#FF3300" />
                </td>
            </tr>
            <tr>
                <td class="style13">
                    <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" 
                        Text="Submit" />
                    </td>
                <td class="style13">
                    <asp:Button ID="btnRefresh" runat="server" Text="Refresh" 
                        CausesValidation="False" onclick="btnRefresh_Click" />
                    </td>
                <td class="style13">
                    <asp:Button ID="btnQuit" runat="server" Text="Quit" CausesValidation="False" 
                        onclick="btnQuit_Click" />
                    </td>
            </tr>
        </table>
    
    </div>
    <asp:GridView ID="gvCustomer" runat="server" AutoGenerateColumns="False" 
        Width="403px">
        <Columns>
            <asp:BoundField DataField="CustomerNo" HeaderText="Customer No" />
            <asp:BoundField DataField="FirstName" HeaderText="First Name" />
            <asp:BoundField DataField="LastName" HeaderText="Last Name" />
            <asp:BoundField DataField="PhoneNo" HeaderText="Phone No" />
            <asp:BoundField DataField="EmailId" HeaderText="Email Id" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MyDatabase %>" 
        SelectCommand="SELECT [CUSTOMER_NO], [FIRST_NAME], [LAST_NAME], [EMAIL_ID], [PHONE_NO] FROM [CUSTOMER]">
    </asp:SqlDataSource>
    </form>
</body>
</html>
